<?php get_instance()->view('common/header');?>
<div class="page-container home">
    <?php get_instance()->view('common/sidebar');?>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title"> <?php echo $title ?> </h3>
                    <ul class="page-breadcrumb breadcrumb">
                    	<li class="btn-group"> <a class="btn default ml_5 return" href="<?php echo getUrl('home');?>"><i class="fa fa-chevron-left"></i> 返回</a> </li>
                        <li><i class="fa fa-home"></i> <a href="<?php echo getUrl('home');?>"> 首页  <i class="fa fa-angle-right"></i> </a></li>
                        <li><a href="javascript:void(0);"><?php echo $title ?> </a></li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <!--开始-->
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet">
                        <div class="portlet-body">
                            <div class="table-container">
                                <div class="table-actions-wrapper"> <span> </span></div>
                                <table class="table table-bordered table-hover scoll-title" id="datatable">
                                    <thead>
                                    <tr role="row" class="heading">
                                        <th width="15%">配送员</th>
                                        <th width="30%">银行信息</th>
                                        <th width="10%">金额</th>
                                        <th width="10%">完成时间</th>
                                        <th width="10%">申请时间</th>
                                        <th width="5%">状态</th>
                                        <th width="7%">操作</th>
                                    </tr>
                                    <tr>
                                        <th><input class="form-control form-filter input-sm" name="keyword" type="text" placeholder="请输入用户名或手机号码"></th>
                                        <th></th>
                                        <th></th>
                                        <th>
                                            <div class="margin-bottom-5">
                                                <input class="form-control form-filter input-sm" name="confirm_time_from" dp placeholder="从" type="text">
                                            </div>
                                            <input class="form-control form-filter input-sm" name="confirm_time_to" dp placeholder="到" type="text" >
                                        </th>
                                        <th>
                                            <div class="margin-bottom-5">
                                                <input class="form-control form-filter input-sm" name="addtime_from" dp placeholder="从" type="text">
                                            </div>
                                            <input class="form-control form-filter input-sm" name="addtime_to" dp placeholder="到" type="text" >
                                        </th>
                                        <th>
                                            <select name="status" class="form-control form-filter input-sm">
                                                <option value="0" selected>所有</option>
                                                <?php foreach ($status as $k => $v):?>
                                                <option value="<?php echo $k;?>"><?php echo $v;?></option>
                                                <?php endforeach;?>
                                            </select>
                                        </th>
                                        <th>
                                            <div class="btn-group">
                                                <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                <ul role="menu" class="dropdown-menu pull-right">
                                                    <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                </ul>
                                            </div>
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody></tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--结束-->
        </div>
    </div>
</div>
<div id="view-modal" style="top:20%;" class="modal fade modal_small" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
    <div class="modal-dialog" style="width:300px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">拒绝提现原因</h4>
            </div>
                <div class="modal-body">
                    
                </div>
                <div class="modal-footer">
                    <button class="btn default" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> 关闭</button>
                </div>
                <script type="text/javascript">
					$(function(){
						var modal = $('#view-modal');	
						$('.view-btn').live('click', function(){
							var content = $(this).find('.content').html();
							modal.find('.modal-body').html(content);
							modal.modal();
						});
					});
                </script>
        </div>
    </div>
</div>
<div id="save-modal" class="modal fade modal_small" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">拒绝打款理由</h4>
            </div>
            <form action="<?php echo getUrl('deliveryman/withdrawCash/changeStatus');?>" class="form-horizontal" id="save-form" method="get">
                <div class="modal-body">
                    <div class="form-group">
                        <label class="control-label col-md-2">拒绝理由<span class="required">*</span></label>
                        <div class="col-md-9">
                            <textarea  class="form-control required" name="reason" ></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <input type="hidden" name="id" value="">
                    <input type="hidden" name="status" value="3">
                    <button class="btn green">保存</button>
                    <button class="btn default" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> 关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        var model = $('#save-modal');

        $('.edit-btn').live('click', function(){
            var id = $(this).attr('data-id');
            model.find('[name="id"]').val(id);
            model.find('.has-error').removeClass('has-error').find('.validate_message').remove();
            model.find('.show_message_error').remove();
            model.modal();
        });
        $.e_validate.init('#save-form',{modal:model,ignore:'',successCallback:function(data){
            $('#datatable').dataTable().fnDraw();
        }});
    });
</script>
<script type="text/javascript">
    $(function(){
        datatable_init({
            src: $("#datatable"),
            sAjaxSource: "<?php echo getUrl('deliveryman/withdrawCash/getList');?>",
            bSort:false
        });

        $('[dp]').not("[noinit]").datepicker({
            changeMonth: true,
            autoclose: true,
            format: "yyyy-mm-dd",
            language: 'zh-CN'
        });
    });
</script>
</body>
</html>